<?	
	header("Content-Type: text/html; charset=UTF-8",true); 

	//if( ( !isset($_SESSION['login_efetuado'])) && ($_SESSION['tipo_login'] != 'funcionario') ){
	//	header("Location: http://suporte.celuladigital.com.br");
	//}
	
	//$sql = " SELECT problema FROM celula_erros where ativo = 'SIM' and sistema = 'Imobiliaria' and status = 'RESOLVIDO' and not tags = '%VERSAO%' ";
	//$conexao->executa($sql);
	//$conexao->dados();
?>
<style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>

<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr bgcolor="#999999">
    <td align="center" valign="middle" bgcolor="#999999">ATENDIMENTO V.S. STATUS</td>
  </tr>
  <tr>
    <td align="center" valign="middle">
    <? 
	$sql = " SELECT (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'NOVO' AND sistema = 'Imobiliaria') AS NOVO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVENDO' AND sistema = 'Imobiliaria') AS RESOLVENDO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'PENDENTE' AND sistema = 'Imobiliaria') AS PENDENTE, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVIDO' AND sistema = 'Imobiliaria') AS RESOLVIDO ";
	$conexao->executa($sql);
	$conexao->dados();
	
	echo "<img src='http://chart.apis.google.com/chart?chco=666666&cht=p&amp;chd=t:".$conexao->data["NOVO"].",".$conexao->data["RESOLVENDO"].",".$conexao->data["PENDENTE"].",".$conexao->data["RESOLVIDO"]."&amp;chs=300x150&amp;chl=Novo(".$conexao->data["NOVO"].")|Resolvendo(".$conexao->data["RESOLVENDO"].")|Pendente(".$conexao->data["PENDENTE"].")|Resolvido(".$conexao->data["RESOLVIDO"].")' />";
	?><br />
      <span class="style1">Célula Imobiliária</span></td>
  </tr>
  <tr>
    <td align="center" valign="middle" class="style1"><? 
	$sql = " SELECT (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'NOVO' AND sistema = 'Restaurante') AS NOVO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVENDO' AND sistema = 'Restaurante') AS RESOLVENDO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'PENDENTE' AND sistema = 'Restaurante') AS PENDENTE, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVIDO' AND sistema = 'Restaurante') AS RESOLVIDO ";
	$conexao->executa($sql);
	$conexao->dados();
	
	echo "<img src='http://chart.apis.google.com/chart?chco=666666&cht=p&amp;chd=t:".$conexao->data["NOVO"].",".$conexao->data["RESOLVENDO"].",".$conexao->data["PENDENTE"].",".$conexao->data["RESOLVIDO"]."&amp;chs=300x150&amp;chl=Novo(".$conexao->data["NOVO"].")|Resolvendo(".$conexao->data["RESOLVENDO"].")|Pendente(".$conexao->data["PENDENTE"].")|Resolvido(".$conexao->data["RESOLVIDO"].")' />";
	?><br />
    Célula Restaurante</td>
  </tr>
  <tr>
    <td align="center" valign="middle"><? 
	$sql = " SELECT (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'NOVO' AND sistema = 'Website') AS NOVO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVENDO' AND sistema = 'Website') AS RESOLVENDO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'PENDENTE' AND sistema = 'Website') AS PENDENTE, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVIDO' AND sistema = 'Website') AS RESOLVIDO ";
	$conexao->executa($sql);
	$conexao->dados();
	
	echo "<img src='http://chart.apis.google.com/chart?chco=666666&cht=p&amp;chd=t:".$conexao->data["NOVO"].",".$conexao->data["RESOLVENDO"].",".$conexao->data["PENDENTE"].",".$conexao->data["RESOLVIDO"]."&amp;chs=300x150&amp;chl=Novo(".$conexao->data["NOVO"].")|Resolvendo(".$conexao->data["RESOLVENDO"].")|Pendente(".$conexao->data["PENDENTE"].")|Resolvido(".$conexao->data["RESOLVIDO"].")' />";
	?><br />
      <span class="style1">Portais Web</span></td>
  </tr>
  <tr>
    <td align="center" valign="middle"><? 
	$sql = " SELECT (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'NOVO' AND sistema = 'Outros') AS NOVO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVENDO' AND sistema = 'Outros') AS RESOLVENDO, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'PENDENTE' AND sistema = 'Outros') AS PENDENTE, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVIDO' AND sistema = 'Outros') AS RESOLVIDO ";
	$conexao->executa($sql);
	$conexao->dados();
	
	echo "<img src='http://chart.apis.google.com/chart?chco=666666&cht=p&amp;chd=t:".$conexao->data["NOVO"].",".$conexao->data["RESOLVENDO"].",".$conexao->data["PENDENTE"].",".$conexao->data["RESOLVIDO"]."&amp;chs=300x150&amp;chl=Novo(".$conexao->data["NOVO"].")|Resolvendo(".$conexao->data["RESOLVENDO"].")|Pendente(".$conexao->data["PENDENTE"].")|Resolvido(".$conexao->data["RESOLVIDO"].")' />";
	?><br />
      <span class="style1">Outros</span></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="middle" bgcolor="#999999">ATENDIMENTOS V.S. SISTEMAS</td>
  </tr>
  <tr>
    <td align="center" valign="middle"><? 
	$sql = " SELECT (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and sistema = 'Imobiliaria') AS IMOBILIARIA, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and sistema = 'Restaurante') AS RESTAURANTE, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and sistema = 'Outros') AS OUTROS, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and sistema = 'Website') AS WEBSITE ";
	$conexao->executa($sql);
	$conexao->dados();
	
	echo "<img src='http://chart.apis.google.com/chart?chco=666666&cht=p&amp;chd=t:".$conexao->data["IMOBILIARIA"].",".$conexao->data["RESTAURANTE"].",".$conexao->data["WEBSITE"].",".$conexao->data["OUTROS"]."&amp;chs=300x150&amp;chl=Imobiliaria(".$conexao->data["IMOBILIARIA"].")|Restaurante(".$conexao->data["RESTAURANTE"].")|Website(".$conexao->data["WEBSITE"].")|Outros(".$conexao->data["OUTROS"].")' />";
	?><br /></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="middle" bgcolor="#999999">ATENDIMENTOS V.S TEMPO</td>
  </tr>
  <tr>
    <td align="center" valign="middle">SELECT status FROM celula_erros WHERE ativo = 'SIM' AND MONTH(data_criacao) = 1<img src='http://chart.apis.google.com/chart?cht=lc&chco=ff0000,00ff00,0000ff,000000&chs=400x125&chd=t:10,50,40,80,30,10,80,70,100|10,50,100,50|5,60|60,100&chxt=x&chxl=0:|Jan|Fev|Mar|Abr|Mai|Jun|Jul|Ago|Set|Out|Nov|Dez' />
    <img src='http://chart.apis.google.com/chart?cht=lc&chco=ff0000,00ff00,0000ff&chs=200x125&chd=s:FOETHECat,lkjtf3asv,KATYPSNXJ&chxt=x,y&chxl=0:|Jan|Fev|Mar|1:||Novo||Resolvendo||Pendente' /></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="middle" bgcolor="#999999">SOLUÇÃO V.S PROBLEMAS</td>
  </tr>
  <tr>
    <td align="center" valign="middle"><? 
	$sql = " SELECT (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM' and status = 'RESOLVIDO') AS STATUS, (SELECT count(id_erros) FROM celula_erros WHERE ativo = 'SIM') AS SOMA ";
	$conexao->executa($sql);
	$conexao->dados();
	
	echo "<img src='http://chart.apis.google.com/chart?chs=250x125&cht=gom&chds=0,".$conexao->data["SOMA"]."&chd=t:".$conexao->data["STATUS"]."&chl=Resolvidos(".$conexao->data["STATUS"]."/".$conexao->data["SOMA"].")' />";
	?></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
</table>
